﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MainFrame : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.ASPxNavBar1.Groups.Clear();
        this.ASPxNavBar1.Font.Size = FontUnit.Parse("10pt");
        using (DAL.CMSDALDataContext DataContext = new DAL.CMSDALDataContext())
        {
            List<DAL.BI_FFunctions> groupList = DataContext.BI_FFunctions.Where(o => o.ParentID == "0").ToList();
            foreach (DAL.BI_FFunctions group in groupList)
            {
                DevExpress.Web.ASPxNavBar.NavBarGroup Nbgroup = this.ASPxNavBar1.Groups.Add(group.Description, group.FucnctionID);
                List<DAL.BI_FFunctions> itemList = DataContext.BI_FFunctions.Where(o => o.ParentID == group.FucnctionID).ToList();
                foreach (DAL.BI_FFunctions item in itemList)
                {
                    Nbgroup.Items.Add(item.Description, item.FucnctionID, string.Empty, item.Url);
                }
            }
        }
    }
}
